package com.example.common;

import lombok.Data;

import java.util.List;

/**
 * 功能描述
 * 返回的错误对象
 *
 * @author: jimmy
 * @date: 2023年12月25日 14:41
 */
@Data
public class CommonError {
    //错误码
    private Integer errCode;

    //错误描述
    private String errMsg;
    //错误描述
    private List<String> errMsgList;

    public CommonError(Integer errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public CommonError(Integer errCode, List<String> errMsgList) {
        this.errCode = errCode;
        this.errMsgList = errMsgList;
    }

    public CommonError(BusinessError businessError) {
        this.errCode = businessError.getErrCode();
        this.errMsg = businessError.getErrMsg();
    }

}
